// @ts-check
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')

module.exports = {
    entry:'./src/main.js',
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: '[name].bundle.js'
    },
    mode: 'development',
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader'
                }
            }
        ]
    },
    devServer: {
        contentBase: "./dist",
        host: 'localhost',
        port: '3000'
    },
    devtool:'source-map',
    plugins: [
        new HtmlWebpackPlugin({
            template: './public/index.html'
        })
    ]
}